function data = readComplexData(filepath, width, height, type)

    assert(isequal(type, 'int16') || isequal(type, 'single'));

    fid = fopen(filepath, 'rb'); % 大端
    if fid == -1
        error("cannot open: %s", filepath);
    end

    data = fread(fid, [2, width*height], type, 'b');
    fclose(fid);
    
    if isequal(type, 'int16')
        data = int16(data);
    elseif isequal(type, 'single')
        data = single(data);
    end
    
    data = complex(data(1,:), data(2,:));

    data = reshape(data, [width, height]);
    data = data';
end
